<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>octant.ocean.state</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="octant-module.html">Package&nbsp;octant</a> ::
        <a href="octant.ocean-module.html">Package&nbsp;ocean</a> ::
        Module&nbsp;state
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="octant.ocean.state-module.html">Module octant.ocean.state</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python2.4</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-docstring">"""</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">Tools for working with oceanic data</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">numpy</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"> </tt>
<a name="rho_stp"></a><div id="rho_stp-def"><a name="L7"></a><tt class="py-lineno"> 7</tt> <a class="py-toggle" href="#" id="rho_stp-toggle" onclick="return toggle('rho_stp');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.ocean.state-module.html#rho_stp">rho_stp</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">,</tt><tt class="py-param">t</tt><tt class="py-op">,</tt><tt class="py-param">p</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="rho_stp-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="rho_stp-expanded"><a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring">    returns density as a function of:</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring">     s = Salinity in psu,</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-docstring">     t = Temperature in deg C,</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring">     p = Pressure in dbar (default = 0)</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line">    <tt class="py-name">p1</tt> <tt class="py-op">=</tt> <tt class="py-number">999.842594</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line">    <tt class="py-name">p2</tt> <tt class="py-op">=</tt>   <tt class="py-number">6.793952E-2</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">    <tt class="py-name">p3</tt> <tt class="py-op">=</tt>  <tt class="py-op">-</tt><tt class="py-number">9.09529E-3</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">    <tt class="py-name">p4</tt> <tt class="py-op">=</tt>   <tt class="py-number">1.001685E-4</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">    <tt class="py-name">p5</tt> <tt class="py-op">=</tt>  <tt class="py-op">-</tt><tt class="py-number">1.120083E-6</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">    <tt class="py-name">p6</tt> <tt class="py-op">=</tt>   <tt class="py-number">6.536332E-9</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">    <tt class="py-name">p7</tt> <tt class="py-op">=</tt>   <tt class="py-number">8.24493E-1</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">    <tt class="py-name">p8</tt> <tt class="py-op">=</tt>  <tt class="py-op">-</tt><tt class="py-number">4.0899E-3</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line">    <tt class="py-name">p9</tt> <tt class="py-op">=</tt>   <tt class="py-number">7.6438E-5</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">    <tt class="py-name">p10</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">8.2467E-7</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">    <tt class="py-name">p11</tt> <tt class="py-op">=</tt>  <tt class="py-number">5.3875E-9</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">    <tt class="py-name">p12</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">5.72466E-3</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">    <tt class="py-name">p13</tt> <tt class="py-op">=</tt>  <tt class="py-number">1.0227E-4</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">    <tt class="py-name">p14</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">1.6546E-6</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">    <tt class="py-name">p15</tt> <tt class="py-op">=</tt>  <tt class="py-number">4.8314E-4</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">    <tt class="py-name">k1</tt> <tt class="py-op">=</tt> <tt class="py-number">19652.21</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">    <tt class="py-name">k2</tt> <tt class="py-op">=</tt>   <tt class="py-number">148.4206</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">    <tt class="py-name">k3</tt> <tt class="py-op">=</tt>    <tt class="py-op">-</tt><tt class="py-number">2.327105</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">    <tt class="py-name">k4</tt> <tt class="py-op">=</tt>     <tt class="py-number">1.360477E-2</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">    <tt class="py-name">k5</tt> <tt class="py-op">=</tt>    <tt class="py-op">-</tt><tt class="py-number">5.155288E-5</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">    <tt class="py-name">k6</tt> <tt class="py-op">=</tt>     <tt class="py-number">3.239908</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">    <tt class="py-name">k7</tt> <tt class="py-op">=</tt>     <tt class="py-number">1.43713E-3</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">    <tt class="py-name">k8</tt> <tt class="py-op">=</tt>     <tt class="py-number">1.16092E-4</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">    <tt class="py-name">k9</tt> <tt class="py-op">=</tt>    <tt class="py-op">-</tt><tt class="py-number">5.77905E-7</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">    <tt class="py-name">k10</tt> <tt class="py-op">=</tt>    <tt class="py-number">8.50935E-5</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">    <tt class="py-name">k11</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">6.12293E-6</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">    <tt class="py-name">k12</tt> <tt class="py-op">=</tt>    <tt class="py-number">5.2787E-8</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">    <tt class="py-name">k13</tt> <tt class="py-op">=</tt>   <tt class="py-number">54.6746</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">    <tt class="py-name">k14</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">0.603459</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">    <tt class="py-name">k15</tt> <tt class="py-op">=</tt>    <tt class="py-number">1.09987E-2</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">    <tt class="py-name">k16</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">6.1670E-5</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">    <tt class="py-name">k17</tt> <tt class="py-op">=</tt>    <tt class="py-number">7.944E-2</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">    <tt class="py-name">k18</tt> <tt class="py-op">=</tt>    <tt class="py-number">1.6483E-2</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">    <tt class="py-name">k19</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">5.3009E-4</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">    <tt class="py-name">k20</tt> <tt class="py-op">=</tt>    <tt class="py-number">2.2838E-3</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">    <tt class="py-name">k21</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">1.0981E-5</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">    <tt class="py-name">k22</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">1.6078E-6</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">    <tt class="py-name">k23</tt> <tt class="py-op">=</tt>    <tt class="py-number">1.91075E-4</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">    <tt class="py-name">k24</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">9.9348E-7</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">    <tt class="py-name">k25</tt> <tt class="py-op">=</tt>    <tt class="py-number">2.0816E-8</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">    <tt class="py-name">k26</tt> <tt class="py-op">=</tt>    <tt class="py-number">9.1697E-10</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">    <tt class="py-name">ro_st0</tt> <tt class="py-op">=</tt> <tt class="py-name">p1</tt> <tt class="py-op">+</tt> <tt class="py-name">p2</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> <tt class="py-op">+</tt> <tt class="py-name">p3</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">+</tt> <tt class="py-name">p4</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">3</tt> <tt class="py-op">+</tt> <tt class="py-name">p5</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">4</tt> <tt class="py-op">+</tt> <tt class="py-name">p6</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">5</tt>\ </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line">            <tt class="py-op">+</tt> <tt class="py-name">p7</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">p8</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> <tt class="py-op">+</tt> <tt class="py-name">p9</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">p10</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">p11</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">4</tt><tt class="py-op">*</tt><tt class="py-name">s</tt>\ </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">            <tt class="py-op">+</tt> <tt class="py-name">p12</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt> <tt class="py-op">+</tt> <tt class="py-name">p13</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt> <tt class="py-op">+</tt> <tt class="py-name">p14</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt> <tt class="py-op">+</tt> <tt class="py-name">p15</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">    <tt class="py-name">k_stp</tt> <tt class="py-op">=</tt> <tt class="py-name">k1</tt> <tt class="py-op">+</tt> <tt class="py-name">k2</tt><tt class="py-op">*</tt><tt class="py-name">t</tt> <tt class="py-op">+</tt> <tt class="py-name">k3</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">+</tt> <tt class="py-name">k4</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">3</tt> <tt class="py-op">+</tt> <tt class="py-name">k5</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">4</tt>\ </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k6</tt><tt class="py-op">*</tt><tt class="py-name">p</tt> <tt class="py-op">+</tt> <tt class="py-name">k7</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">p</tt> <tt class="py-op">+</tt> <tt class="py-name">k8</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">p</tt> <tt class="py-op">+</tt> <tt class="py-name">k9</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">p</tt>\ </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k10</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">+</tt> <tt class="py-name">k11</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">+</tt> <tt class="py-name">k12</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt>\ </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k13</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k14</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k15</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k16</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">3</tt><tt class="py-op">*</tt><tt class="py-name">s</tt>\ </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k17</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt> <tt class="py-op">+</tt> <tt class="py-name">k18</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt> <tt class="py-op">+</tt> <tt class="py-name">k19</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt>\ </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k20</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k21</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k22</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k23</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">*</tt><tt class="py-name">s</tt><tt class="py-op">**</tt><tt class="py-number">1.5</tt>\ </tt>
<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line">           <tt class="py-op">+</tt> <tt class="py-name">k24</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k25</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt class="py-name">k26</tt><tt class="py-op">*</tt><tt class="py-name">t</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">p</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">s</tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">ro_st0</tt><tt class="py-op">/</tt><tt class="py-op">(</tt><tt class="py-number">1.0</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">/</tt><tt class="py-name">k_stp</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line"> </tt>
<a name="o2_sat"></a><div id="o2_sat-def"><a name="L67"></a><tt class="py-lineno">67</tt> <a class="py-toggle" href="#" id="o2_sat-toggle" onclick="return toggle('o2_sat');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.ocean.state-module.html#o2_sat">o2_sat</a><tt class="py-op">(</tt><tt class="py-param">T</tt><tt class="py-op">,</tt><tt class="py-param">S</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="o2_sat-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="o2_sat-expanded"><a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">    <tt class="py-docstring">"""returns saturation concentrations of o2 [ millimole O2 / m3 ] for </tt> </tt>
<a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line"><tt class="py-docstring">    a given temperature and salinity (at STP)"""</tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">    <tt class="py-name">A1</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">173.4292</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line">    <tt class="py-name">A2</tt> <tt class="py-op">=</tt>  <tt class="py-number">249.6339</tt> </tt>
<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line">    <tt class="py-name">A3</tt> <tt class="py-op">=</tt>  <tt class="py-number">143.3483</tt> </tt>
<a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line">    <tt class="py-name">A4</tt> <tt class="py-op">=</tt>  <tt class="py-op">-</tt><tt class="py-number">21.8492</tt> </tt>
<a name="L74"></a><tt class="py-lineno">74</tt>  <tt class="py-line">    <tt class="py-name">B1</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">0.033096</tt> </tt>
<a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line">    <tt class="py-name">B2</tt> <tt class="py-op">=</tt>    <tt class="py-number">0.014259</tt> </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line">    <tt class="py-name">B3</tt> <tt class="py-op">=</tt>   <tt class="py-op">-</tt><tt class="py-number">0.0017000</tt> </tt>
<a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line">    <tt class="py-comment"># Convert T to deg. C to deg. K</tt> </tt>
<a name="L78"></a><tt class="py-lineno">78</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-name">T</tt> <tt class="py-op">=</tt> <tt class="py-name">T</tt> <tt class="py-op">+</tt> <tt class="py-number">273.15</tt> </tt>
<a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line">    <tt class="py-comment"># O2 Concentration in mg/l</tt> </tt>
<a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment"># [from Millero and Sohn, Chemical Oceanography, CRC Press, 1992]</tt> </tt>
<a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-name">O</tt> <tt class="py-op">=</tt> <tt id="link-0" class="py-name" targets="Variable octant.ocean.depths.exp=octant.ocean.depths-module.html#exp,Variable octant.ocean.exp=octant.ocean-module.html#exp,Variable octant.ocean.state.exp=octant.ocean.state-module.html#exp,Variable octant.ocean.step3d_t.exp=octant.ocean.step3d_t-module.html#exp,Variable octant.ocean.time.exp=octant.ocean.time-module.html#exp,Variable octant.ocean.velocity.exp=octant.ocean.velocity-module.html#exp"><a title="octant.ocean.depths.exp
octant.ocean.exp
octant.ocean.state.exp
octant.ocean.step3d_t.exp
octant.ocean.time.exp
octant.ocean.velocity.exp" class="py-name" href="#" onclick="return doclink('link-0', 'exp', 'link-0');">exp</a></tt><tt class="py-op">(</tt><tt class="py-name">A1</tt> <tt class="py-op">+</tt> <tt class="py-name">A2</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">100.0</tt><tt class="py-op">/</tt><tt class="py-name">T</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">A3</tt><tt class="py-op">*</tt><tt id="link-1" class="py-name" targets="Variable octant.ocean.depths.log=octant.ocean.depths-module.html#log,Variable octant.ocean.log=octant.ocean-module.html#log,Variable octant.ocean.state.log=octant.ocean.state-module.html#log,Variable octant.ocean.step3d_t.log=octant.ocean.step3d_t-module.html#log,Variable octant.ocean.time.log=octant.ocean.time-module.html#log,Variable octant.ocean.velocity.log=octant.ocean.velocity-module.html#log"><a title="octant.ocean.depths.log
octant.ocean.log
octant.ocean.state.log
octant.ocean.step3d_t.log
octant.ocean.time.log
octant.ocean.velocity.log" class="py-name" href="#" onclick="return doclink('link-1', 'log', 'link-1');">log</a></tt><tt class="py-op">(</tt><tt class="py-name">T</tt><tt class="py-op">/</tt><tt class="py-number">100.0</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">A4</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">T</tt><tt class="py-op">/</tt><tt class="py-number">100.0</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> \ </tt>
<a name="L82"></a><tt class="py-lineno">82</tt>  <tt class="py-line">            <tt class="py-name">S</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">B1</tt> <tt class="py-op">+</tt> <tt class="py-name">B2</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">T</tt><tt class="py-op">/</tt><tt class="py-number">100.0</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">B3</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">T</tt><tt class="py-op">/</tt><tt class="py-number">100.0</tt><tt class="py-op">)</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line">    <tt class="py-comment"># Convert to mmol/m3</tt> </tt>
<a name="L84"></a><tt class="py-lineno">84</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#  mmol/m3 = 44.66 ml/l</tt> </tt>
<a name="L85"></a><tt class="py-lineno">85</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#  mg/l = ml/l * 1.42903 mg/ml</tt> </tt>
<a name="L86"></a><tt class="py-lineno">86</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">return</tt> <tt class="py-name">O</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">44.66</tt><tt class="py-op">*</tt><tt class="py-number">1.42903</tt><tt class="py-op">)</tt> </tt>
</div><a name="L87"></a><tt class="py-lineno">87</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Apr 20 11:56:31 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
